<template>
	<view class="container">
		<uni-list>
			<!-- <uni-list-item title="个人信息" link to="/pages/user/info"></uni-list-item> -->
			<uni-list-item title="修改密码" link to="/pages/user/pwd"></uni-list-item>
			<uni-list-item title="意见反馈" link to="/pages/mine/feedlist"></uni-list-item>
			<uni-list-item title="隐私政策" link to="/pages/user/privacy"></uni-list-item>
			<uni-list-item title="使用协议" link to="/pages/user/agreement"></uni-list-item>
		</uni-list>
		
		<view class="logout" @click="userLogout">退出登陆</view>
		
	</view>
</template>
<script>
import { logout, userinfo } from "@/api/base.js"
let that;
export default {
	data() {
		return {
			userInfo: {},		//用户信息	
		}
	},
	onLoad(){
		that = this
		this.getUserInfo()
	},
	methods: {
		/**
		 * 获取用户信息
		 */
		getUserInfo(){
			let that = this
			userinfo().then((res) => {
				that.userInfo = res.data
			})
		},
		/**
		 * 退出登录
		 */
		userLogout(){
			logout().then(res => {
				if(res.code == '0'){
					uni.clearStorageSync()		
					uni.reLaunch({
						url: "/pages/index/index"
					})
				}
			})
		}
	}
}
</script>
<style>
@import '@/common/uni-nvue.css';
.logout {
	position: relative;
	top: 26vh;
	background-color: #eee;
	width: 90%;
	margin: 0 5%;
	padding: 12px 0;
	text-align: center;
	border-radius: 20rpx;
	color: #555;
}
</style>